Skip to content

Fix snapshot test for warn_dots_used()#6830

Closed
lionel- wants to merge 1 commit into
tidyverse:mainfrom
lionel-:rlang-fix
Closed

Fix snapshot test for warn_dots_used()#6830
lionel- wants to merge 1 commit into
tidyverse:mainfrom
lionel-:rlang-fix

Conversation

@lionel-
Copy link
Copy Markdown
Member

@lionel- lionel- commented Apr 1, 2026

rlang now uses the new R API for environments and dots to figure out whether a promise is forced or not: r-lib/rlang#1880. One concrete change from this is that we can only see the state of the final promise in a promise chain, which causes a revdep failure with ggplot2 (r-lib/rlang#1891).

Here is the flow:

  • ggplot(foobar = "nonsense") dispatches on the first argument, in this case "nonsense". This forces the promise in the ggplot() frame here:

    UseMethod("ggplot")

  • fortify() is called and passes "nonsense" via ... to the NULL method:

    data <- fortify(data, ...)

  • The NULL method returns to the generic, which checks for dots used here, hitting the new rlang behaviour:

    warn_dots_used()

The workaround implemented in this PR is to explicitly pass data = NULL to ggplot() to avoid forcing the promise on dispatch.

@lionel- lionel- mentioned this pull request Apr 1, 2026
11 tasks
@teunbrand teunbrand changed the base branch from main to rc/4.0.3 April 13, 2026 07:01
@teunbrand teunbrand changed the base branch from rc/4.0.3 to main April 13, 2026 07:01
@arcresu
Copy link
Copy Markdown
Contributor

arcresu commented May 11, 2026

This commit was merged as part of #6843 so the PR can probably be closed?

@teunbrand teunbrand closed this May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants